<!--component html goes here -->
<div bsModal #createCategoryModal="bs-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="createCategoryModal" aria-hidden="true" [config]="{backdrop: 'static'}">
    <div class="modal-dialog">
        <div class="modal-content">

            <form *ngIf="active" #createCategoryForm="ngForm" novalidate (ngSubmit)="save()">

                <div class="modal-header">
                    <button type="button" class="close" (click)="close()" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                    <h4 class="modal-title">
                        <span>创建分类</span>
                    </h4>
                </div>

                <div class="modal-body">
                    <div class="form-group">
                        <label>分类名称</label>
                        <input class="form-control" type="text" name="name" [(ngModel)]="category.name" required maxlength="32" minlength="2">
                    </div>
                </div>

                <div class="modal-footer">
                    <button [disabled]="saving" type="button" class="btn btn-default" (click)="close()">{{l("Cancel")}}</button>
                    <button type="submit" class="btn btn-primary blue" [disabled]="!createCategoryForm.form.valid"><i class="fa fa-save"></i> <span>{{l("Save")}}</span></button>
                </div>
            </form>
        </div>
    </div>
</div>